import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/base";

// 查询测试设计列表
export function listTestDesign(query) {
  return request({
    url: '/tms/testdesign/',
    method: 'get',
    params: query
  })
}

// 查询测试设计详细
export function getTestDesign(id) {
  return request({
    url: `/tms/testdesign/${parseStrEmpty(id)}/`,
    method: 'get'
  })
}

// 查询测试设计详细历史
export function getHistory(id) {
  return request({
    url: `/tms/testdesign/${id}/history/`,
    method: 'get',
  })
}

// 新增测试设计
export function addTestDesign(data) {
  return request({
    url: '/tms/testdesign/',
    method: 'post',
    data: data
  })
}

// 修改测试设计
export function updateTestDesign(data) {
  return request({
    url: `/tms/testdesign/${data.id}/`,
    method: 'put',
    data: data
  })
}

// 删除测试设计
export function delTestDesign(id) {
  return request({
    url: `/tms/testdesign/${id}/`,
    method: 'delete'
  })
}